package com.oa.co.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.oa.co.mapper.PcMapper;
import com.oa.co.pojo.Pc;
import com.oa.co.service.PcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("pcService")
public class PcServiceImpl implements PcService {
    @Autowired
    private PcMapper pcMapper;

    @Override
    public PageInfo<Pc> getPageData(Integer page, Integer limit, Integer pc_id, String pc_user) {

        Pc pc = new Pc();
        pc.setPc_id(pc_id);
        pc.setPc_user(pc_user);

        PageHelper.startPage(page,limit);

        List<Pc> pcs = pcMapper.selectPc(pc);

        PageInfo<Pc> pcPageInfo = new PageInfo<>(pcs);


        return pcPageInfo;
    }
}
